import pymysql

def create_database_connection(host, port, database_name,user_name, password):
    connection = pymysql.Connect(
        host=host,
        port=port,
        database=database_name,
        user=user_name,
        password=password,
        charset="utf8",
        autocommit=True,
    )
    return connection

def release_database_connection(connection):
    connection.close()

def execute_sql_script(connection,sql_script):
    cursor =  connection.cursor()
    cursor.execute(sql_script)
    connection.commit()
    result = cursor.fetchall()
    cursor.close()
    return result

